<template>
  <cm-card>
    <div slot="header">
      <span>基本信息</span>
    </div>
    <div class="text">
      <cm-table
        :data="tableData_6"
        class="title_bg no-th-title"
        border
        :span-method="objectSpanMethod"
        style="width: 100%">
        <cm-table-column
          label="标题1"
          width="150">
          <template slot-scope="scope">
            <div>{{scope.row.text0}}</div>
          </template>
        </cm-table-column>
        <cm-table-column
          prop="text1"
          label="信息1">
          <template slot-scope="scope">
            <div v-if="scope.row.isFile =='true'" class="blue-text">
              {{scope.row.text1}}
              <span class="down_btn"><i class="el-icon-download"></i>下载</span>
            </div>
            <div v-else>{{scope.row.text1}}</div>
          </template>
        </cm-table-column>
        <cm-table-column
          prop="text2"
          label="标题2"
          class="title_bg"
          width="150">
        </cm-table-column>
        <cm-table-column
          prop="text3"
          label="信息2">
        </cm-table-column>
      </cm-table>
    </div>
  </cm-card>

</template>

<script>
  export default {
    name: "info",
    methods: {
      objectSpanMethod({row, column, rowIndex, columnIndex}) {
        if (rowIndex === 2 || rowIndex === 3 || rowIndex === 4) {
          if (columnIndex === 1) {
            return [1, 3];
          } else if (columnIndex === 2) {
            return [0, 0];
          }
        }
      }
    },

    data() {
      return {
        tableData_6: [{
          text0: '合同名称',
          text1: '合作外包信息化合同',
          text2: '合同编号',
          text3: 'IM00019900',
          isFile: 'false'
        }, {
          text0: '合同性质',
          text1: '承包',
          text2: '履行期限类型',
          text3: 'xxxx类',
          isFile: 'false'
        }, {
          text0: '其他执行人',
          text1: '无',
          text2: '我是内容',
          text3: '我是内容',
          isFile: 'false'
        }, {
          text0: '合同签署说明',
          text1: '合同签署说明xxxxxxx',
          text2: '我是内容',
          text3: '我是内容',
          isFile: 'false'
        }]
      }
    }
  }
</script>

<style lang="scss">

  .el-table.title_bg_1 tr>td[rowspan="2"]:nth-child(1),
  .el-table.title_bg tr>td:nth-child(1),
  .el-table.title_bg tr>td:nth-child(3){
    background-color: #F8F8F8!important;
    color: #12171F!important;
  }


</style>
